<header>
    <title>商品{notempty name="goods"}修改{else /}添加{/notempty}</title>
</header>
{include file="public/header" /}
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">

            <form class="layui-form" action="" method="post">
                {notempty name="goods"}<input type="hidden" name="id" value="{$goods.id}">{/notempty}
                <div class="layui-form-item">
                    <label class="layui-form-label">商品名称：</label>
                    <div class="layui-input-block">
                        <input style="width:190px;" type="text" name="goods_name" {notempty name="goods"}value="{$goods.goods_name}"{/notempty} required  lay-verify="required"  placeholder="请输入商品名称" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">商品价格：</label>
                    <div class="layui-input-block">
                        <input style="width:190px;" type="text" name="price" {notempty name="goods"}value="{$goods.price}"{/notempty} required  lay-verify="required"  placeholder="请输入商品价格" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">关键字：</label>
                    <div class="layui-input-block">
                        <input style="width:190px;" type="text" name="keyword" {notempty name="goods"}value="{$goods.keyword}"{/notempty} required  lay-verify="required"  placeholder="请输入搜索关键字" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item" style="width: 300px">
                    <label class="layui-form-label">选择品牌：</label>
                    <div class="layui-input-block">
                        <select name="brand_id" lay-verify="required">
                            {foreach $list as $key=>$vo }
                                <option value="{$vo.id}" {notempty name="goods"}{if $vo['id']==$goods['brand_id']}selected{/if}{/notempty}>{$vo.brand_name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>


                <div class="layui-form-item" style="width: 300px">
                    <label class="layui-form-label">选择分类：</label>
                    <div class="layui-input-block">
                        <select name="cate_id"  lay-verify="">
                            {foreach $info as $key=>$vo }
                            <option value="{$vo.id}" {notempty name="goods"}{if $vo['id']==$goods['cate_id']}selected{/if}{/notempty} style="width: 300px"><?php echo $vo['cate_name'] ?></option>
                            {/foreach}
                        </select>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">商品描述</label>
                    <div class="layui-input-block">
                        <textarea style="width: 200px" name="describe" placeholder="请输入内容" class="layui-textarea">{notempty name="goods"}{$goods.describe}{/notempty} </textarea>
                    </div>
                </div>


                <br>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

            <script>
                //Demo
                layui.use('form', function(){
                    var form = layui.form;

                    //监听提交
                    form.on('submit(formDemo)', function(data){

                    });
                });
            </script>
            {include file="public/footer" /}